const {ccclass, property} = cc._decorator;

@ccclass
export default class BaseScene extends cc.Component {
    // LIFE-CYCLE CALLBACKS:
    protected onLoad(): void {
        window.addEventListener("orientationchange", this._onOrientationchange.bind(this));
        this._updateResolutionSize();
    }
    
    private _onOrientationchange(){
        setTimeout(this._onOrientationchange.bind(this), 0);
    }

    private _updateResolutionSize(){
        if(cc.view.getVisibleSize().width > cc.view.getVisibleSize().height){
            cc.view.setDesignResolutionSize(750, 1334, cc.ResolutionPolicy.FIXED_HEIGHT);
        }else{
            cc.view.setDesignResolutionSize(750, 1334, cc.ResolutionPolicy.FIXED_WIDTH);
        }
    }
}